// Copyright 2004 The Trustees of Indiana University.
// Copyright 2005 Matthias Troyer.
// Copyright 2006 Douglas Gregor <doug.gregor -at- gmail.com>.
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//  Authors: Douglas Gregor
//           Andrew Lumsdaine
//           Matthias Troyer
//
//  Jeongnim Kim imported mpi/datatype.h to keep the same interfaces
#ifndef QMCPLUSPLUS_HDF_DATATYPES_H
#define QMCPLUSPLUS_HDF_DATATYPES_H

namespace APPNAMESPACE {

#if defined(HAVE_LIBHDF5)
#include <hdf5.h>
template <typename T>                              
inline hid_t                                     
get_h5_datatype(const T&) { return MPI_NATIVE_CHAR;}

#define BOOSTSUB_H5_DATATYPE(CppType, MPIType)                         \
template<>                                                             \
inline hid_t                                                           \
get_h5_datatype< CppType >(const CppType&) { return MPIType; }         

/// INTERNAL ONLY
BOOSTSUB_H5_DATATYPE(short, H5T_NATIVE_SHORT);

/// INTERNAL ONLY
BOOSTSUB_H5_DATATYPE(int, H5T_NATIVE_INT);

/// INTERNAL ONLY
BOOSTSUB_H5_DATATYPE(long, H5T_NATIVE_LONG);

/// INTERNAL ONLY
BOOSTSUB_H5_DATATYPE(float, H5T_NATIVE_FLOAT);

/// INTERNAL ONLY
BOOSTSUB_H5_DATATYPE(double, H5T_NATIVE_DOUBLE);
#else
  typedef int hid_t;

  //return a non-sense integer
  template <typename T>                              
    inline hid_t                                     
    get_h5_datatype(const T&) { return 0;}
#endif
}

#endif
